﻿using System;

namespace ASquared.ModelOptimization
{
    /// <summary>An implementation for a class that can be defined as a model of a complex system.</summary>
    /// <remarks>This model must have code that will exit its own routine on convergence (as determined by objected.IsConverged).</remarks>
    public interface IConditionalGradientSolvableModel
    {
        // Events
        /// <summary>An event raised at the beginning of the initial iteration.</summary>
        event EventHandler Init;
        /// <summary>An event raised at the beginning of each iteration.</summary>
        event EventHandler IterBottom;
        /// <summary>An event raised when the model has converged on a solution (at the end of iterations).</summary>
        event EventHandler Converged;

        // Running the model 
        /// <summary>Begins simulation of the model.</summary>
        void Run();
        /// <summary>Resets problem setup to begin at Iteration 0 again.</summary>
        /// <remarks>This may include setting the costs back to what they were.</remarks>
        void Reset(); 

        // Properties to interact with during model solution
        /// <summary>Defines the iteration (zero-based) of the model.</summary>
        Int32 Iteration { get; }
        /// <summary>Defines the objective function.</summary>
        IConditionalGradientSolvableFunction objective { get; set; }
    }
}
